﻿using System;
using System.Collections.Generic;
using System.Linq;
using SqlSugar;
namespace Chat_Model
{
    /// <summary>
    /// 用户聊天列表
    ///</summary>
    [SugarTable("lar_talk_list")]
    public class LarTalkList
    {
        /// <summary>
        /// 聊天列表ID 
        ///</summary>
        [SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsIdentity = true)]
        public int Id { get; set; }
        /// <summary>
        /// 聊天类型[1:私信;2:群聊;] 
        /// 默认值: 1
        ///</summary>
        [SugarColumn(ColumnName = "talk_type")]
        public int TalkType { get; set; } = 1;
        /// <summary>
        /// 用户ID 
        /// 默认值: 0
        ///</summary>
        [SugarColumn(ColumnName = "user_id")]
        public int? UserId { get; set; }
        /// <summary>
        /// 是否置顶[0:否;1:是;] 
        /// 默认值: 0
        ///</summary>
        [SugarColumn(ColumnName = "is_top")]
        public byte IsTop { get; set; }
        /// <summary>
        /// 消息免打扰[0:否;1:是;] 
        /// 默认值: 0
        ///</summary>
        [SugarColumn(ColumnName = "is_disturb")]
        public byte IsDisturb { get; set; }
        /// <summary>
        /// 创建时间 
        ///</summary>
        [SugarColumn(ColumnName = "created_at")]
        public DateTime? CreatedAt { get; set; } = DateTime.Now;
        /// <summary>
        /// 更新时间 
        ///</summary>
        [SugarColumn(ColumnName = "updated_at")]
        public DateTime? UpdatedAt { get; set; } = DateTime.Now;
        /// <summary>
        /// 接收者ID（用户ID 或 群ID） 
        /// 默认值: 0
        ///</summary>
        [SugarColumn(ColumnName = "receiver_id")]
        public int ReceiverId { get; set; }
        /// <summary>
        /// 是否删除[0:否;1:是;] 
        /// 默认值: 0
        ///</summary>
        [SugarColumn(ColumnName = "is_delete")]
        public byte IsDelete { get; set; }
        /// <summary>
        /// 是否机器人[0:否;1:是;] 
        /// 默认值: 0
        ///</summary>
        [SugarColumn(ColumnName = "is_robot")]
        public byte IsRobot { get; set; } = 0;
        /// <summary>
        /// 聊天记录
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public List<LarTalkRecords> LarTalkRecordsList { get; set; }
        /// <summary>
        /// 群组
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public LarGroup LarGroup  {get;set;}
        /// <summary>
        /// 用户
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public LarUsers LarUsers { get; set; }
    }
}
